package com.baselibrary.libs.View.TestView;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;

/**
 * Created by Administrator 于萌萌
 * 创建日期: 16:10 . 2017年03月03日
 * 描述:直线
 * <p>
 * <p>
 * 备注:
 */

public class MyView2 extends View {
    public MyView2(Context context) {
        super(context);
    }

    public MyView2(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyView2(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }


    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        // 画布 canvas
        // 画笔 paint
        Paint paint = new Paint();
        //抗锯齿
        paint.setAntiAlias(true);
        //设置画笔颜色
        paint.setColor(Color.RED);
      //  paint.setStyle(Paint.Style.FILL);

        canvas.drawLine(400,400,50,50,paint);
        //设置画布背景颜色
       // canvas.drawRGB(255, 255,255);



    }



}
